const {imgUrl} = getApp().globalData
Component({
  behaviors: [],
  properties: {
  },
  data: {
    imgUrl: imgUrl + 'tender/',
    current: 0,
    ptList: [
      {isOpen: true},
      {isOpen: false},
      {isOpen: true},
      {isOpen: true},
      {isOpen: true},
      {isOpen: true},
      {isOpen: true},
      {isOpen: true},
      {isOpen: true},
      {isOpen: true},
    ]
  },
  lifetimes: {
    created() {
    },
    attached() {
    },
    moved() {
    },
    detached() {
    },
  },
  methods: {
    onChange(event) {
      this.setData({
        current: event.currentTarget.dataset.current
      });
    },
    openItem(event) {
      let index = event.currentTarget.dataset.index;
      let list = JSON.parse(JSON.stringify(this.data.ptList));
      list[index].isOpen = !list[index].isOpen;
      this.setData({
        ptList: list
      })
    }
  },
});